#include"mymap.h"
#include"myset.h"

void test_map()
 {
   wgm::map<int, int> m;
   m.insert({1, 1});
   m.insert({5, 5});
   m.insert({2, 2});
   m.insert({6, 6});
   wgm::map<int, int>::iterator it = m.begin();
   while(it != m.end())
   {
     it->second += 1;
     cout << it->first << ":" << it->second << endl;
     ++it;
   }
 }

void Print(const wgm::set<int>& s)
{
  wgm::set<int>::const_iterator it = s.end();
  while(it != s.begin())
  {
    --it;
    cout << *it << " ";
  }
  cout << endl;
}

void test_set()
{
  wgm::set<int> s;
  int a[] = {4, 2, 6, 1, 3, 5, 15, 7, 16, 14};
  for(auto e : a)
  {
    s.insert(e);
  }
  wgm::set<int>::iterator it = s.begin();
  while(it != s.end())
  {
    cout << *it << " ";
    ++it;
  }
  cout << endl;
  it = s.end();
  while(it != s.begin())
  {
    --it;
    cout << *it << " ";
  }
  cout << endl;
  Print(s);
}

int main()
{
  test_map();
  test_set();
  return 0;
}
